Skip to content

Fix master CI: import OrdinaryDiffEq sub-packages explicitly#62

Merged
ChrisRackauckas merged 4 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-master-solver-imports
May 11, 2026
Merged

Fix master CI: import OrdinaryDiffEq sub-packages explicitly#62
ChrisRackauckas merged 4 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-master-solver-imports

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

After OrdinaryDiffEq v7's split into sub-packages, TRBDF2 is no longer in scope from a bare using OrdinaryDiffEq. Import OrdinaryDiffEqSDIRK explicitly so the tests in dirichlet_source.jl, fisher.jl, heat.jl, porous_medium.jl, and robin_diffusion.jl resolve it.

Master CI on this repo has been red since the OrdinaryDiffEq v7 ecosystem-bump merge. This PR resolves the 5x UndefVarError: TRBDF2 not defined failures.

Note: after the import is fixed, two additional pre-existing master failures remain (NOT introduced by this PR):

  1. The explicit_imports.jl test fails because src/precompilation.jl does using PrecompileTools rather than using PrecompileTools: @setup_workload, @compile_workload.
  2. The 4 PDE tests now hit a BoundsError at [exact_solution.(mesh_points, sol.t[i]) for i in eachindex(sol)] because eachindex(::ODESolution) returns CartesianIndices{2} under SciMLBase v3 / RecursiveArrayTools v4 instead of Base.OneTo as before. Test code needs to switch to eachindex(sol.t) (or similar).

Both are out of scope for this PR per task constraints. Filing as a separate concern.

Ignore until reviewed by @ChrisRackauckas.

After OrdinaryDiffEq v7's split into sub-packages, `TRBDF2` is no
longer in scope from a bare `using OrdinaryDiffEq`. Import
OrdinaryDiffEqSDIRK explicitly so the tests resolve it, and add the
sub-package to the test/Project.toml deps.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
… eachindex(sol)

Under SciMLBase v3 / RecursiveArrayTools v4, `eachindex(::ODESolution)` returns
a `CartesianIndices{2}`, so generators like
`[exact_solution.(mesh_points, sol.t[i]) for i in eachindex(sol)]` index
`sol.t::Vector` with a `CartesianIndex{2}` and throw a `BoundsError`. The
intended iteration is over time steps, so iterate over `eachindex(sol.t)`.

Also replace `using PrecompileTools` in `src/precompilation.jl` with an
explicit `using PrecompileTools: @setup_workload, @compile_workload` so the
`check_no_implicit_imports` test passes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Iteration 2 update

Pushed 1800be1 addressing the two second-order issues from iteration 1:

  1. eachindex(sol) BoundsError — under SciMLBase v3 / RecursiveArrayTools v4, eachindex(::ODESolution) returns CartesianIndices{2}, which fails when used to index sol.t::Vector in
    [exact_solution.(mesh_points, sol.t[i]) for i in eachindex(sol)]. Adapted to eachindex(sol.t) in 5 sites across porous_medium.jl, robin_diffusion.jl, dirichlet_source.jl, heat.jl.
  2. check_no_implicit_imports failure — replaced using PrecompileTools with using PrecompileTools: @setup_workload, @compile_workload in src/precompilation.jl.

CI status after this commit (Julia 1 + lts)

Both targeted issues resolved. Test summary went from 60 passed / 5 errored to 66 passed / 1 failed / 3 errored. The remaining 4 failures are a separate, pre-existing class:

  • 3 errors: @test_reference PSNR mismatch on *_surface.png reference images (PSNR ~22-23 vs threshold 25), affecting porous_surface.png, robin_diffusion_surface.png, dirichlet_source_surface.png.
  • 1 failure: same root cause for dirichlet_source_surface.png flagged differently.

These were latent on main (the TRBDF2 ImportError pre-empted them in the previous CI run) and are caused by Makie/CairoMakie renderer drift since the references were committed. Reproduces deterministically with the same PSNR values across Julia 1 and lts. The numerical tests against analytical solutions still pass (rtol 1e-1 / 1e-2), so the underlying solver is correct — only the rendered PNG bytes drifted.

The clean fix is to regenerate the reference PNGs on a GitHub-Actions runner so byte-identical reproducibility is guaranteed, but doing that locally (sandbox renderer differs from CI's) would just shift the failure. Out of scope for this PR's targeted fixes; recommend a follow-up PR that runs JULIA_REFERENCETESTS_UPDATE=true in CI and commits the regenerated images.

…rences

The reaction-diffusion test's analytical solution involves exp(-16π² t) and
exp(-25π² t) terms, which decay to O(1e-3) by t = 0.05. Default solver
tolerances (abstol = 1e-6, reltol = 1e-3) leave residuals comparable to the
signal itself, so the rtol = 0.1 comparison against the closed-form exact_u
no longer holds under OrdinaryDiffEq v7's TRBDF2 step-size heuristics.
Tighten the solver tolerances (abstol = 1e-10, reltol = 1e-8) so the
comparison is meaningful (norm error drops from ~0.26 to ~1.6e-5 relative).
Apply the same tighter tolerances in the matching docs example so the
displayed figure can be reproduced from the documented code.

Regenerate the three surface PNG references (porous_surface,
robin_diffusion_surface, dirichlet_source_surface) against CairoMakie v0.15
output. Renderer/font changes since the references were committed dropped
PSNR below 25 (22.14 / 22.69 / 21.76) without any change to the underlying
solutions; the regenerated PNGs match the CairoMakie v0.15 renderer used
on current CI.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Comment thread test/dirichlet_source.jl Outdated
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review May 11, 2026 17:57
@ChrisRackauckas ChrisRackauckas merged commit 2d1c767 into SciML:main May 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants